// 创建useDispatch和useSelector的hooks类型化版本
import type {RootState,AppDispatch} from './index'
import {TypedUseSelectorHook,useSelector,useDispatch} from 'react-redux'

// 自定义新的hooks 以后在组件中使用 useAppDistpatch 和 useAppSelector
export const useAppDistpatch:()=>AppDispatch = useDispatch
// 避免在组件中使用useSelector时，每次引入RootState给state做类型注解
export const useAppSelector:TypedUseSelectorHook<RootState> = useSelector
